Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds async runtime support to the WebAssembly Component Model C++ library, providing cooperative task scheduling functionality. The implementation includes a Store for managing pending work, Thread objects for async operations, and a Call interface for cancellation support.
Key changes:
- Implementation of async runtime components (
Store,Thread,Call,FuncInst) with cooperative scheduling - Comprehensive test coverage for both successful execution and cancellation scenarios
- Documentation updates explaining usage patterns for the new async functionality
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
include/cmcpp/runtime.hpp |
Complete async runtime implementation with Store, Thread, and Call classes |
include/cmcpp.hpp |
Adds runtime.hpp include to main header |
test/main.cpp |
Comprehensive test case covering async execution and cancellation |
README.md |
Documentation and usage examples for the new async runtime |
| using ResumeFn = std::function<bool(bool)>; | ||
| using CancelFn = std::function<void()>; | ||
|
|
||
| static std::shared_ptr<Thread> create(Store &store, ReadyFn ready, ResumeFn resume, bool cancellable = false, CancelFn on_cancel = {}); |
There was a problem hiding this comment.
[nitpick] The parameter order places the boolean cancellable before the optional on_cancel function. Consider moving cancellable to the end or making it part of the CancelFn presence check to improve API usability.
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
helpers fixes #4 Signed-off-by: Gordon Smith <GordonJSmith@gmail.com>
helpers
fixes #4